import java.util.*;

public class ArrTest3 {

	public static void main(String[] args) {
		int[] a = new int[8];
		System.out.println("长度是：" + a.length);
		Scanner sc = new Scanner(System.in);
		for (int i = 0; i < a.length; i++) {
			System.out.printf("请输入第%d个数：", i + 1);
			a[i] = sc.nextInt();
		}

		System.out.println("您的输入如下：");
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + "\t");
		}
		int sum = 0;
		for (int i = 0; i < a.length; i++) {
			sum = sum + a[i];
		}
		System.out.println();
		System.out.println("和是:" + sum);
		int avg = sum / a.length;
		System.out.println("平均：" + avg);
		// a[0] = sc.nextInt();
		// a[1] = sc.nextInt();
		// a[2] = sc.nextInt();

	}

}
